home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_481 / tlpatch / source / translate.c < prev   
C/C++ Source or Header  |  1992-05-06  |  993b  |  47 lines

  1. /* Translate.c */
  2. /* adapted from RKM pp 3-145 */
  3.  
  4. #include <exec/types.h>
  5. #include <exec/exec.h>
  6. #include <exec/nodes.h>
  7. #include <exec/lists.h>
  8. #include <exec/memory.h>
  9. #include <exec/interrupts.h>
  10. #include <exec/libraries.h>
  11. #include <exec/io.h>
  12. #include <exec/tasks.h>
  13. #include <exec/execbase.h>
  14. #include <libraries/translator.h>
  15.  
  16. struct Library *TranslatorBase = 0;
  17. UBYTE *phonemes[500];
  18. WORD rtncode;
  19.  
  20. extern struct Library *OpenLibrary();
  21.  
  22. main(argc,argv)
  23. int argc;
  24. char *argv[];
  25. {
  26.     if(argc < 2)
  27.     {
  28.         printf("Usage: %s <text>\n",*argv);
  29.         exit(0);
  30.     }
  31.     if((TranslatorBase = (struct Library *)OpenLibrary("translator.library",0L)) == NULL)
  32.     {
  33.         printf("Can't open the translator library\n");
  34.       exit(-100);
  35.     }
  36.     if((rtncode = Translate(argv[1],strlen(argv[1]),phonemes,500)) != 0)
  37.         printf("Translator error - %d\n",rtncode);
  38.     else
  39.     {
  40.         printf("\n    Text = %s\n",argv[1]);
  41.         printf("Phonemes = %s\n\n",phonemes);
  42.     }
  43.     if(TranslatorBase != 0)
  44.         CloseLibrary(TranslatorBase);
  45.     exit(0);
  46. }
  47.